<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('策划师')"/>
</head>
<body class="gray-bg">
<h3 th:text="${companyName}" ></h3>
<h4>策划师列表</h4>
<div class="container-div" >
    <div class="row">
    <div class="col-sm-12 search-collapse">
    <form class="form-horizontal m" id="form-host-edit" >
        <input id="companyId" name="companyId" type="hidden" th:value="${companyId}"/>
    </form>
     </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
     </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "user/company";
    var companyId = $("#companyId").val();
    $(function () {
        var options = {
            url: prefix + "/listPlanner/"+companyId,
            sortName: "plannerId",
            modalName: "策划师",
            sortOrder: "asc",
            columns: [{
                checkbox: false
            },
                {
                    field: 'plannerId',
                    title: '编号'
                },
                {
                    field: 'plannerName',
                    title: '策划师姓名'
                },
                {
                    field: 'plannerPhone',
                    title: '联系方式'
                },
                {
                    field: 'plannerDate',
                    title: '创建时间',
                    sortable: true
                },
                {
                    field: 'plannerOrder',
                    title: '订单量'
                },
                {
                    field: 'plannerState',
                    title: '账号状态',
                    formatter: function (value, row, index) {
                        if (value == 0) {
                            return "<span style='color:green;'>空闲</span>";
                        }else if (value == 1){
                            return "<span style='color:pink;'>正在策划</span>";
                        }
                        return "休假";
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        return "详情";
                    }
                }]
        };
        $.table.init(options);

    });

</script>
</body>
</html>